#include <iostream>
#include <stdlib.h>

using namespace std;

template<class T>
void count(T*a, int n,int& c,int b);  

int main()
{
    int a[]={1,2,3,4,5,6,67,4,23,45,2,4,2};
    int n=12,c=0,s=2;
    //while(a[n]!='/n') n++;

    count(a,n,c,s);
    cout<<c<<endl;
    
    system("pause");
    return 0;
}

template<class T>
void count(T* a,int n,int& c,int b)
{
    for(int i=0;i<n;i++)
    {
        if(*(a+i)==b) c++;
    }
}